package com.bbx.flink.demo.data_stream_state.operator_state;

import com.bbx.flink.demo.data_stream_state.functions.OperatorStateDemoFunction;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * 输入元素   ，输出元素计数个数
 * 例   输入    输出
 *      1       1
 *      3       2
 *      9       3
 *      111     4
 */
public class OperatorStateDemo {

    public static void main(String  [] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        env.setParallelism(1);
        env.socketTextStream("192.168.10.131",10003)
                .map(new OperatorStateDemoFunction())
                .print();
        env.execute();
    }
}
